﻿function ProcessContainer(position, size, color, parmas) {

    svg.attr("height", parmas.svgHeight + 200);

    NodeContainer.apply(this, [position, size, color, parmas]);

    this._textRect = svg.append("rect")
        .attr("rx", parmas.r)
        .attr("ry", parmas.r)
        .attr("fill", parmas.color)
        .attr("stroke", "black")
        .attr("stroke-width", "1")
        .attr("cursor", "move")
        .attr("stroke-dasharray", parmas.dasharray)
        .attr("width", this.getSize().w)
        .attr("height", 20)
    this._text = svg.append('text').attr("font-size", "9").attr("fill", "rgb(0,0,127)").text(parmas.text)

    this.onUpdateLayout = function () {
        this._domEl.attr("x", this.getActualPosition().x)
            .attr("y", this.getActualPosition().y)
            .attr("id", parmas.id)
            .attr("width", this.getSize().w)
            .attr("height", this.getSize().h);

        this._textRect.attr("x", this.getActualPosition().x).attr("y", this.getActualPosition().y).attr("tag", "rect");
        this._text.attr("x", this.getActualPosition().x + this.getSize().w / 2).attr("y", this.getActualPosition().y + 11);

        for (var i = 0; i < this.children.length; i++) {
            this.children[i].updateLayout();
        }
        if (this.logFlag) {
            worker.postMessage("Create a Image:  x:" + this._position.x + ", y:" + this._position.x + ", width:" + this._size.w + ", height:" + this._size.h);
        }
        this.logFlag = false;
    };
}